fix(autofix): Remove race condition with autofix:clean label on bootstrap PRs#220
fix(autofix): Remove race condition with autofix:clean label on bootstrap PRs#220
Conversation
…trap PRs When autofix found no changes, it would add the autofix:clean label. This caused a race condition with Codex bootstrap PRs: 1. Bootstrap commit created (minimal code) 2. First autofix runs, finds 'no changes' → adds autofix:clean 3. Real code pushed with formatting issues 4. Second autofix runs in clean mode (due to label) → skips full fix The fix: Don't add autofix:clean as an outcome label. It should only be used as a trigger label (input). Fixes #217
There was a problem hiding this comment.
Pull request overview
This PR fixes a race condition where the autofix:clean label was incorrectly added to PRs when autofix found no changes, causing subsequent autofix runs on bootstrap PRs to enter clean mode prematurely and skip fixing actual formatting issues.
- Removed logic that added
autofix:cleanlabel when no changes were found - Added clarifying comment explaining that
autofix:cleanis a trigger, not an outcome - Updated "no changes" summary to show "(none)" instead of "
autofix:clean" for labels
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Automated Status SummaryHead SHA: 333cf3f
Coverage Overview
Coverage Trend
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
🤖 Keepalive Loop StatusPR #220 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
The diagnostic block added in PR #1643 references PR_REF to show unpushed commits, but PR_REF is only in the commit step's env block, not the run step's. Under set -euo pipefail the unbound variable crashes the entire step, preventing Claude's output from being captured and the commit step from running. This is why PR #220's Claude runs produced zero output despite the runner fixes being present. Fix: use ${PR_REF:-} to safely handle the missing variable. Also add artifact upload step (mirrors reusable-codex-run.yml) so Claude's session JSONL, output, and analysis files are preserved for debugging even when the run fails. https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
…odex The --output-file flag does not exist in the Claude CLI, causing it to exit immediately with code 1 (unknown option). This was introduced in PR #1643 and is the root cause of Claude runs failing on PR #220. Changes to reusable-claude-run.yml: - Remove invalid --output-file and --output-format stream-json flags - Use shell redirect with tee for session logging + output capture - Use PIPESTATUS[0] to capture Claude exit code through the pipe - Rename session files from .jsonl to .log (Claude text != JSONL) - Add agents/*.md bootstrap file exclusion (matches Codex pattern) - Add cross-agent artifact exclusion (codex-session/analysis files) Changes to reusable-codex-run.yml: - Add cross-agent artifact exclusion for claude-* files so shared workspace artifacts don't leak into Codex commits https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
Automated Status Summary
Scope
Tasks
Acceptance criteria
Head SHA: 45051ac
Latest Runs: ⏳ queued — Gate
Required: gate: ⏳ queued